import { objectTargetValue } from "../common";
// 获取 error的message
function getErrorMessage(err: any) {
    return objectTargetValue(err, [
        "message",
        "msg",
        "errMsg",
        "errmsg",
        "errorMsg",
        "errorMessage",
    ]);
}

function getErrorCode(err: any) {
    return objectTargetValue(err, ["code", "errCode", "errcode", "errorCode", "errorcode"]);
}

export { getErrorMessage, getErrorCode };
